$(function () {
    User.myOrder.execution(null);
    var data=User.myOrder.getResult();
    biud(data);
    $("select[name='quiz']").change(function () {
        User.myOrder.execution(($(this).val()=="null"||$(this).val()==null)?null:$(this).val());
        var data=User.myOrder.getResult();
        biud(data);
    });
});
function biud(data) {

    /*
    cancelCause:"超时，未支付"
    cancelCauseTime:"2019-07-23 21:58:46"
    commodityName:"《哪吒》 真人巡回演出，带你回忆童年 山西站"
    contactNumber:"18735438348"
    count:3
    deliverType:3
    itemImgUrl:null
    mainOrderId:1
    orderNum:"123456789"
    orderTime:"2019-07-23 21:58:46"
    postage:10
    remarks:"备注信息"
    sessionTime:"2019-08-04 A场"
    showAddress:"山西省体育中心体育馆"
    skuId:1
    status:4
    takeAddress:null
    ticketDrawer:"翟小龙"
    totalPrice:1800

     */
    if(data.errorCode==0000){
        $(".xka1").html("<p>\n" +
            "  \t\t\t\t\t<span class=\"xka1-1\">演出信息</span><span class=\"xka1-2\">数量</span><span class=\"xka1-3\">支付总金额</span><span class=\"xka1-4\">状态</span><span class=\"xka1-5\">操作</span>\n" +
            "  \t\t\t\t</p>");
        for(var i=0;i<data.data.length;i++)
            $(".xka1>p").after("<div class=\"xka1-0\">\n" +
                "  \t\t\t\t\t<p>\n" +
                "\t  \t\t\t\t\t<span>下单时间："+data.data[i].orderTime+"</span><span>订单号:"+data.data[i].contactNumber+"</span>\n" +
                "\t  \t\t\t\t</p>\n" +
                "\t  \t\t\t\t<div class=\"xka1-6 clearfix\">\n" +
                "\t  \t\t\t\t\t<div class=\"xka1-7  fl\">\n" +
                "\t\t  \t\t\t\t\t<a href=\"\" class=\"clearfix\">\n" +
                "\t\t  \t\t\t\t\t\t<img src=\""+data.data[i].itemImgUrl+"\" class=\"fl\">\n" +
                "\t\t  \t\t\t\t\t\t<div class=\"fr\">\n" +
                "\t\t  \t\t\t\t\t\t\t<span class=\"xka1-7-1\">"+data.data[i].commodityName+"</span><br>\n" +
                "\t\t\t  \t\t\t\t\t\t<span>"+data.data[i].showAddress+"</span><br>\n" +
                "\t\t\t  \t\t\t\t\t\t<span>"+data.data[i].sessionTime+"</span>\n" +
                "\t\t  \t\t\t\t\t\t</div>\t\n" +
                "\t\t  \t\t\t\t\t</a>\t  \t\t \t\t\t\t\n" +
                "\t  \t\t\t\t\t</div>\n" +
                "\t  \t\t\t\t\t<div class=\"xka1-8 fl\"><span>×"+data.data[i].count+"</span></div>\n" +
                "\t  \t\t\t\t\t<div class=\"xka1-9 fl\"><span>￥"+(data.data[i].totalPrice==null?0.00:data.data[i].totalPrice.toFixed(2))+"<br><span class=\"xka1-9-1\">(含运费:￥"+(data.data[i].postage==null?0.00:data.data[i].postage.toFixed(2))+")</span></span></div>\n" +
                "\t  \t\t\t\t\t<div class=\"xka1-10 fl\"><span>"+(data.data[i].status==0?"待支付":data.data[i].status==1?"待出票":data.data[i].status==2?"待收货":data.data[i].status==3?"已完成":data.data[i].status==4?"已取消":"已退款")+"</span></div>\n" +
                "\t  \t\t\t\t\t<div class=\"xka1-11 fl\"><a href=\"http://cn.pn.com:8080/static/html/myorder.html?orderNumber="+data.data[i].orderNum+"\"><span>订单详情</span></a></div>\n" +
                "\t  \t\t\t\t</div>\n" +
                "  \t\t\t\t</div>");
    }else{
        layer.msg("暂无订单");
    }

}